<script language="javascript" type="text/javascript" src="/js/jquery.simpletreeview.min.js"></script>
<script type="text/javascript">
 $(document).ready(function() {
  $("#archives").simpletreeview({
                 open: '<span style="color: #900;">&darr;</span>',
                 close: '<span style="color: #090;">&rarr;</span>',
                 slide: true,
                 speed: 'fast',
                 collapsed: true,
                 expand: '0.0'
                });
 });
</script>
<?php
if($this->stat == "added")
{
?>
	<div id="success_msg">previllege successfully saved</div>
<?php
} else if ($this->stat == "updated") {
?>
	<div id="success_msg">previllege successfully updated</div>
<?php
} else if ($this->stat == "deleted") {
?>
	<div id="success_msg">previllege successfully deleted</div>
<?php
}
?>
<?php

?>

<div>
    <form name="previllegeassignform" action="/admin/previllege/index/" id="previllegeassignform" method="post">
         <input type="submit" name="submit" id="submit" value="save">
        <ul id="archives" class="treeview">
             <?php foreach($this->prevviewarr as $key1=>$val1):?>
			<li>
				<?php echo  $key1;?>
				<ul>
                                    <?php foreach($this->rolearr as $role):?>
					<li>
						<?php echo  $role;?>
						<ul >
                                                     <?php foreach($this->actionarr as $act):?>
							<li>  <?php echo  $act;?>&nbsp;&nbsp; : &nbsp;&nbsp;<input <?php echo ($val1[$role][$act]==1)?"checked":"";?> value="1" type="checkbox" name="previllegeassign[<?php echo  $key1."-".$role."-".$act; ?>]" id="" ></li>
                                                      <?php endforeach;?>
						</ul>
					</li>
                                    <?php endforeach;?>
				</ul>
			</li>
                        <?php  endforeach;?>
		</ul>
                         <input type="submit" name="submit" id="submit" value="save">
    </form>
</div>

